/*
 * Powered By [rapid-framework]
 * Web Site: http://www.rapid-framework.org.cn
 * Google Code: http://code.google.com/p/rapid-framework/
 * Since 2008 - 2018
 */

package com.bm.console.business.impl;
import com.sys.object.common.page.PageBean;

import com.bm.console.business.WebHouseTypeRelationService;
import com.bm.console.pojo.WebHouseTypeRelation;
import com.bm.console.pojo.mapper.WebHouseTypeRelationMapper;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.sys.object.common.page.PageBean;
@Service
public class WebHouseTypeRelationServiceImpl implements WebHouseTypeRelationService {

	@Autowired
	WebHouseTypeRelationMapper webHouseTypeRelationMapper;

	@Override
	public PageBean queryPageList(WebHouseTypeRelation entity, PageBean page) throws Exception {
		int rowCount = webHouseTypeRelationMapper.selectByPageCount(entity);
		page.setRowCount(rowCount);
		entity.setOffset(page.getStartRow());
		entity.setLimit(page.getPerpage());
		page.setList(webHouseTypeRelationMapper.selectByPage(entity));
		return page;
	}

	public WebHouseTypeRelation queryByPrimaryKey(Integer id) throws Exception {
		return webHouseTypeRelationMapper.selectByPrimaryKey(id);
	}

	public int saveOrUpdate(WebHouseTypeRelation entity) throws Exception {
		if(entity!=null){
			return this.webHouseTypeRelationMapper.updateByPrimaryKeySelective(entity);
		}
		return this.webHouseTypeRelationMapper.insert(entity);
	}

	public int remove(Integer id) throws Exception {
		return this.webHouseTypeRelationMapper.deleteByPrimaryKey(id);
	}

	public int delete(Integer id) throws Exception {
		return this.webHouseTypeRelationMapper.deleteByPrimaryKey(id);
	}
	
	public int updateStatus(WebHouseTypeRelation entity) throws Exception{
		return this.webHouseTypeRelationMapper.updateByPrimaryKeySelective(entity);
	}

	public int updateStatus(String status, String[] ids)
			throws Exception {
		
		return 0;
	}
	

}
